import axios from '@/axios'

export default {
	// 上传单个文件
    async single_file(path, type){
        let formData = new FormData()
        formData.append("file", path)
        let res = await axios.post(
			`/file/${type}/upload-file`,
			formData,
			{
				'Content-Type':'multipart/form-data'
			}
        )
        return res.data
	},
	// 删除指定文件
    async delete_file(fileName){
		let res = await axios({
			url: `/file/${fileName}/delete-file`,
			method: "DELETE"
		})
		return res.data
 	}
}